package A011thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class A005_实现线程方式四_利用ExecutorService线程池的方式创建线程 {
    public static void main(String[] args) throws Exception {
        ExecutorService e = Executors.newFixedThreadPool(10);
        for (int i = 0; i < 10; i++) {
            Thread t = new Thread(new MyThread_4());
            //执行线程体,那个都可以
//			t.start();
            e.execute(t);
        }
        e.shutdown();
    }
}

class MyThread_4 implements Runnable {
    @Override
    public void run() {
        System.out.println("执行线程!");
    }
}